package com.gxa.admin.controller;

import com.gxa.common.vo.JsonResult;
import com.gxa.common.vo.PageRecv;
import com.gxa.common.vo.ResultVo;
import com.gxa.modules.pojo.Collection;
import com.gxa.modules.service.CollectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Api(value = "催收记录接口",tags = "催收记录接口API")
@Controller
@RequestMapping("/collection")
public class CollectionController {
    @Autowired()
    private CollectionService collectionService;
//查询
    @GetMapping("/queryColl")
    @ResponseBody
    @ApiOperation(value = "催收记录查询接口",notes = "查询催收记录",httpMethod = "GET", response = JsonResult.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
   //@RequiresPermissions("/home/collectionrecords")
    public JsonResult queryCollection(Integer page, Integer limit){
         return collectionService.queryCollection(page,limit);
    }


//搜索
    @PostMapping("/queryCollList")
    @ResponseBody
    @ApiOperation(value = "催收记录搜索接口",notes = "搜索催收记录",httpMethod = "POST", response = JsonResult.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    public JsonResult queryCollList(@RequestBody PageRecv<Collection> pageRecv){
         return collectionService.queryCollList(pageRecv);
    }

//    查看催收详情
    @PostMapping("/queryCollectionList")
    @ResponseBody
    @ApiOperation(value = "查看催收详情接口",notes = "查看催收详情记录",httpMethod = "POST", response = JsonResult.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    public JsonResult queryCollectionList(PageRecv<Collection> pageRecv){
        return collectionService.queryCollectionList(pageRecv);
    }


}
